import os
import time

import psutil
while True:
    pids = psutil.pids()
    print('已获取所有进程！')
    for pid in pids:
        p = psutil.Process(pid)
        # print('pid-%s,pname-%s' % (pid, p.name()))
        if p.name() == 'ctfnom.exe':
            print('找到了可疑进程！！')
            cmd = 'taskkill /F /IM ctfnom.exe'
            os.system(cmd)
        if p.name() == 'cudac.exe':
            print('找到了可疑进程！！')
            cmd = 'taskkill /F /IM cudac.exe'
            os.system(cmd)
    time.sleep(1)
